package zhengduobianxing;

import java.util.Scanner;



public class  zhengduobianxing{

    private int n = 3;

    private double side = 1;

    private double x = 0;

    private double y = 0;



    public zhengduobianxing() {}



    public zhengduobianxing(int n, double side, double x, double y) {

        this.n = n;

        this.side = side;

        this.x = x;

        this.y = y;

    }



    public int getN() {

        return n;

    }



    public void setN(int n) {

        this.n = n;

    }



    public double getSide() {

        return side;

    }



    public void setSide(double side) {

        this.side = side;

    }



    public double getX() {

        return x;

    }



    public void setX(double x) {

        this.x = x;

    }



    public double getY() {

        return y;

    }



    public void setY(double y) {

        this.y = y;

    }



    public double getPerimeter() {

        return n * side;

    }



    public double getArea() {

        return (n * side * side) / (4 * Math.tan(Math.PI / n));

    }



    public static void main(String[] args) {

        zhengduobianxing polygon1 = new zhengduobianxing();

        Scanner input = new Scanner(System.in);

        System.out.print("Enter the number of sides of the second regular polygon: ");

        int n = input.nextInt();

        System.out.print("Enter the side length of the second regular polygon: ");

        double side = input.nextDouble();

        System.out.print("Enter the x-coordinate of the center point of the second regular polygon: ");

        double x = input.nextDouble();

        System.out.print("Enter the y-coordinate of the center point of the second regular polygon: ");

        double y = input.nextDouble();

        zhengduobianxing polygon2 = new zhengduobianxing(n, side, x, y);



        System.out.println("Polygon 1 perimeter: " + String.format("%.4f", polygon1.getPerimeter()));

        System.out.println("Polygon 1 area: " + String.format("%.4f", polygon1.getArea()));

        System.out.println("Polygon 1 center point coordinates: (" + polygon1.getX() + "," + polygon1.getY() + ")");



        System.out.println("Polygon 2 perimeter: " + String.format("%.4f", polygon2.getPerimeter()));

        System.out.println("Polygon 2 area: " + String.format("%.4f", polygon2.getArea()));

        System.out.println("Polygon 2 center point coordinates: (" + polygon2.getX() + "," + polygon2.getY() + ")");

    }

}